import { eMenuType } from '@/interface/enum';
import { RouteRecordRaw } from 'vue-router';
import { iRouteMeta } from '@/interface/iRouteInfo';
import { getMenuImageUrl } from '@/utils/ui';

const mainHomeMeta: iRouteMeta = {
  menu_show: true,
  menu_type: eMenuType.MENU,
  normal: getMenuImageUrl('alarm_center.png'),
  // hover: getMenuImageUrl('room_hover.png'),
  parentPath: '',
  sort: 1,
  title: '报警管理',
  elements: [],
};

export const alarm_center_router: RouteRecordRaw = {
  name: 'alarm_center',
  path: '/alarm_center',
  meta: mainHomeMeta,
  redirect: '/alarm_center/zfn',
  component: () => import('@/layout/ContentLayout.vue'),
  children: [
    {
      path: '/alarm_center/zfn',
      name: 'alarm_center_zfn',
      redirect: '/alarm_center/records/zfn/datas',
      meta: {
        menu_show: true,
        menu_type: eMenuType.MENU,
        title: '在线监测',
        parentPath: '/alarm_center',
        sort: 1,
      },
      component: () => import('@/views/alarm_center/zfn/index.vue'),
      children: [
        // {
        //   path: '/alarm_center/records/devices',
        //   name: 'alarm_center_records_devices',
        //   meta: {
        //     menu_show: true,
        //     menu_type: eMenuType.PAGE,
        //     title: '设备报警记录',
        //     parentPath: '/alarm_center/records',
        //     sort: 1,
        //   },
        //   component: () => import('@/views/alarm_center/devices/index.vue'),
        // },
        {
          path: '/alarm_center/records/zfn/datas',
          name: 'alarm_center_records_datas',
          meta: {
            menu_show: true,
            menu_type: eMenuType.PAGE,
            title: '数据报警记录',
            parentPath: '/alarm_center/records',
            sort: 1,
          },
          component: () => import('@/views/alarm_center/zfn/datas/index.vue'),
        },
      ],
    },
    {
      path: '/alarm_center/biaoza',
      name: 'alarm_center_biaoza',
      redirect: '/alarm_center/records/biaoza/datas',
      meta: {
        menu_show: false,
        menu_type: eMenuType.MENU,
        title: '硅料表杂设备',
        parentPath: '/alarm_center',
        auth: ['硅料表杂'],
        sort: 1,
      },
      component: () => import('@/views/alarm_center/biaoza/index.vue'),
      children: [
        // {
        //   path: '/alarm_center/records/devices',
        //   name: 'alarm_center_records_devices',
        //   meta: {
        //     menu_show: true,
        //     menu_type: eMenuType.PAGE,
        //     title: '设备报警记录',
        //     parentPath: '/alarm_center/records',
        //     sort: 1,
        //   },
        //   component: () => import('@/views/alarm_center/devices/index.vue'),
        // },
        {
          path: '/alarm_center/records/biaoza/datas',
          name: 'alarm_center_biaoza_datas',
          meta: {
            menu_show: false,
            menu_type: eMenuType.PAGE,
            title: '数据报警记录',
            auth: ['硅料表杂'],
            parentPath: '/alarm_center/records',
            sort: 1,
          },
          component: () => import('@/views/alarm_center/biaoza/datas/index.vue'),
        },
      ],
    },
  ],
};
